<template>
	<div id="">
		<img :src="car.imgUrl" style="width: 300px;display: inline-block;"/>
		<div v-for="item in imgUrlList" style="width: 300px;display: inline-block;">
			
			 <img :src="item.imgUrl"/>
		</div>
			<Card style="width:350px;left: 40%;">
				
					<!-- <h3>{{car.}} </h3> -->
					<div class="hui">
						<span>品牌:{{car.brandName}}</span><br>
						<span>型号:{{car.type}}</span><br>
						<span>里程数{{car.mileage}}</span><br>
						<span>车龄:{{car.carCondition}}</span><br>
						<span>发布人:{{car.personName}}</span><br>
						<span>电话号码:{{car.tel}}</span><br>
						<span>微信号:{{car.wxNumber}}</span><br>
						<span class="amount">￥{{car.rentalPrice}}</span>
					</div>
				</Card>
			
		
	</div>
</template>

<script>
export default {
	data(){
		return{
			car:{},
			carId:42,
			imgUrlList:[],
		}
	},
	methods:{
		searchData: function() {
			this.http.get({
				url: "/car-rental-info/info",
				param: {
					carId:this.$data.carId
				}
			}).then(data => {
				console.log(data)
				this.$data.car = data;
			});
		},
		searchImg:function(){
			this.http.get({
				url:`/car/image/list/${this.$data.carId}`,
			}).then(data => {
				this.$data.imgUrlList = data
				console.log(data)
			})
		}
	},
	created() {
		this.$data.carId = this.$route.params.carId
		this.searchData()
		this.searchImg()
	},
	beforeRouteLeave(to, from, next) {
	    this.$destroy();//手动销毁当前页面
	    next();
	},
}
</script>

<style>
</style>
